crPESetNthTableLogOnInfo
The crPESetNthTableLogOnInfo function sets the log on information for the specified print job.
Declare Function crPESetNthTableLogOnInfo Lib "crwrap32.dll" (ByVal printJob As Integer, ByVal TableN As Integer, ByVal ServerName As String, ByVal dbName As String, ByVal UserID As String, ByVal Password As String, ByVal PropagateAcrossTables As Long) As Integer
Parameters
printJob
| Specifies the handle of the print job for which you want to set table log on information.
|
TableN
| Specifies the number of the table for which you want to set log on information. The first table is table 0. The last table is N-1.
|
ServerName
| Specifies the logon name for the server used to create the report. For ODBC, use the data source name. *
|
dbName
| Specifies the logon name for the database used to create the report. *
|
UserID
| Specifies the user ID# necessary to log on to the server. *
|
Password
| Specifies the password necessary to log on to the server.
|
PropagateAcrossTables
| Indicates whether or not the program should apply the new log on information to any other tables in the report that had the same original server and database names as the specified table. You may use either of the following values:
|
| Value
| Meaning
|
| TRUE
| Program will apply log on information to all other tables that have the same original server and database names.
|
| FALSE
| Program will update only the selected table.
|
Return Value
TRUE (1) if the call is successful, FALSE (0) if the call fails.
Remarks
- The program logs on when printing the report, but you must first set the correct log on information using crPESetNthTableLogOnInfo.
- You must supply at least the password with this function with empty strings for the other parameters. Additionally, you can change the server, database, and/or user name by entering the appropriate values.
- Logging off is performed automatically when the print job is closed.
- crPESetNthTableLogOnInfo allows you to override any of the log on parameters.
- When you create a report off a single database (for example, one MDB file with multiple tables), set the PropagateAcrossTables parameter to TRUE. This insures that the changes are made to all tables in the MDB file (thus avoiding the necessity to code the changes for each table individually).